<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            /* left:0;
            height: 0; */
            margin:0;
            padding: 0;
        }
    canvas{
        
        border: 1px solid #000;
    }
    </style>
</head>
<body>
    <canvas id="myCanvas"></canvas>
    <script>
    const canvas = document.getElementById('myCanvas');
    var ctx = canvas.getContext('2d');
    ctx.fillStyle = 'red';
    ctx.font = "50px Verdana"; 
    let i=1;
    function animation() {
        requestAnimationFrame(function(){
            ctx.clearRect(0,0,300,150);
            ctx.fillText(++i,160,75); 
            animation();
        })
    }
    animation();
    // canvas.width = '50';
    // canvas.style.width = 50 + 'vw';
    // canvas.height = window.innerHeight;
    </script>
</body>
</html>